package com.stone.activemqcase.config;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

import javax.jms.JMSException;
import javax.jms.TextMessage;

/**
 * boot整合activemq  队列生产者
 */
@Component
public class BootTopicConsumer {

    @JmsListener(destination = "${myactivemq}")
    public void receive(TextMessage textMessage){
        try {
            System.out.println("消费者接收消息-------------->"+textMessage.getText());
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }
}
